package com.neoCalf.neoFile.config;

import com.neoCalf.neoFile.pro.MinioProp;
import io.minio.MinioClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;


/**
 * @author 小牛
 * @version 1.0
 * @description TODO
 * @date 2024/12/21 14:15
 */
@Configuration
@Slf4j
public class MinioConfiguration {
    @Resource
    private MinioProp minioProp;

    @Bean
    public MinioClient minioClient() {
        MinioClient build = MinioClient.builder()
                .endpoint(minioProp.getEndpoint())
                .credentials(minioProp.getAccesskey(), minioProp.getSecretKey())
                .build();
        log.info("minioClient初始化成功");
        return build;
    }
}
